﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharpMUD.Framework.Services.Security;
using SharpMUD.Framework.Security;

namespace SharpMUD.Framework.Web.Security
{
    public class MembershipProvider
        : System.Web.Security.MembershipProvider, IUserProvider
    {
        private IUserProvider _UnderlyingProvider;

        #region System.Web.Security.MembershipProvider
        public override string ApplicationName
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public override bool ChangePassword(string username, string oldPassword, string newPassword)
        {
            throw new NotImplementedException();
        }

        public override bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
        {
            throw new NotImplementedException();
        }

        public override System.Web.Security.MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out System.Web.Security.MembershipCreateStatus status)
        {
            throw new NotImplementedException();
        }

        public override bool DeleteUser(string username, bool deleteAllRelatedData)
        {
            throw new NotImplementedException();
        }

        public override bool EnablePasswordReset
        {
            get { throw new NotImplementedException(); }
        }

        public override bool EnablePasswordRetrieval
        {
            get { throw new NotImplementedException(); }
        }

        public override System.Web.Security.MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
        {
            throw new NotImplementedException();
        }

        public override System.Web.Security.MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
        {
            throw new NotImplementedException();
        }

        public override System.Web.Security.MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
        {
            throw new NotImplementedException();
        }

        public override int GetNumberOfUsersOnline()
        {
            throw new NotImplementedException();
        }

        public override string GetPassword(string username, string answer)
        {
            throw new NotImplementedException();
        }

        public override System.Web.Security.MembershipUser GetUser(string username, bool userIsOnline)
        {
            throw new NotImplementedException();
        }

        public override System.Web.Security.MembershipUser GetUser(object providerUserKey, bool userIsOnline)
        {
            throw new NotImplementedException();
        }

        public override string GetUserNameByEmail(string email)
        {
            throw new NotImplementedException();
        }

        public override int MaxInvalidPasswordAttempts
        {
            get { throw new NotImplementedException(); }
        }

        public override int MinRequiredNonAlphanumericCharacters
        {
            get { throw new NotImplementedException(); }
        }

        public override int MinRequiredPasswordLength
        {
            get { throw new NotImplementedException(); }
        }

        public override int PasswordAttemptWindow
        {
            get { throw new NotImplementedException(); }
        }

        public override System.Web.Security.MembershipPasswordFormat PasswordFormat
        {
            get { throw new NotImplementedException(); }
        }

        public override string PasswordStrengthRegularExpression
        {
            get { throw new NotImplementedException(); }
        }

        public override bool RequiresQuestionAndAnswer
        {
            get { throw new NotImplementedException(); }
        }

        public override bool RequiresUniqueEmail
        {
            get { throw new NotImplementedException(); }
        }

        public override string ResetPassword(string username, string answer)
        {
            throw new NotImplementedException();
        }

        public override bool UnlockUser(string userName)
        {
            throw new NotImplementedException();
        }

        public override void UpdateUser(System.Web.Security.MembershipUser user)
        {
            throw new NotImplementedException();
        }

        public override bool ValidateUser(string username, string password)
        {
            throw new NotImplementedException();
        }
        #endregion

        #region SharpMUD.Framework.Services.Security.IUserProvider

        bool IUserProvider.EnablePasswordReset
        {
            get { return _UnderlyingProvider.EnablePasswordReset; }
        }

        bool IUserProvider.EnablePasswordRetrieval
        {
            get { return _UnderlyingProvider.EnablePasswordRetrieval; }
        }

        int IUserProvider.MaxInvalidPasswordAttempts
        {
            get { return _UnderlyingProvider.MaxInvalidPasswordAttempts; }
        }

        int IUserProvider.MinRequiredNonAlphanumericCharacters
        {
            get { return _UnderlyingProvider.MinRequiredNonAlphanumericCharacters; }
        }

        int IUserProvider.MinRequiredPasswordLength
        {
            get { return _UnderlyingProvider.MinRequiredPasswordLength; }
        }

        int IUserProvider.PasswordAttemptWindow
        {
            get { return _UnderlyingProvider.PasswordAttemptWindow; }
        }

        UserPasswordFormat IUserProvider.PasswordFormat
        {
            get { return _UnderlyingProvider.PasswordFormat; }
        }

        string IUserProvider.PasswordStrengthRegularExpression
        {
            get { return _UnderlyingProvider.PasswordStrengthRegularExpression; }
        }

        bool IUserProvider.RequiresQuestionAndAnswer
        {
            get { return _UnderlyingProvider.RequiresQuestionAndAnswer; }
        }

        bool IUserProvider.RequiresUniqueEmail
        {
            get { return _UnderlyingProvider.RequiresUniqueEmail; }
        }

        event UserValidatePasswordEventHandler IUserProvider.ValidatingPassword
        {
            add { _UnderlyingProvider.ValidatingPassword += value; }
            remove { _UnderlyingProvider.ValidatingPassword -= value; }
        }

        bool IUserProvider.ChangePassword(string username, string oldPassword, string newPassword)
        {
            return _UnderlyingProvider.ChangePassword(username, oldPassword, newPassword);
        }

        bool IUserProvider.ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer)
        {
            return _UnderlyingProvider.ChangePasswordQuestionAndAnswer(username, password, newPasswordQuestion, newPasswordAnswer);
        }

        IUser IUserProvider.CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out UserCreateException exception)
        {
            return _UnderlyingProvider.CreateUser(username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey, out exception);
        }

        bool IUserProvider.DeleteUser(string username, bool deleteAllRelatedData)
        {
            return _UnderlyingProvider.DeleteUser(username, deleteAllRelatedData);
        }

        List<IUser> IUserProvider.FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
        {
            return _UnderlyingProvider.FindUsersByEmail(emailToMatch, pageIndex, pageSize, out totalRecords);
        }

        List<IUser> IUserProvider.FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
        {
            return _UnderlyingProvider.FindUsersByName(usernameToMatch, pageIndex, pageSize, out totalRecords);
        }

        List<IUser> IUserProvider.GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
        {
            return _UnderlyingProvider.GetAllUsers(pageIndex, pageSize, out totalRecords);
        }

        int IUserProvider.GetNumberOfUsersOnline()
        {
            return _UnderlyingProvider.GetNumberOfUsersOnline();
        }

        string IUserProvider.GetPassword(string username, string answer)
        {
            return _UnderlyingProvider.GetPassword(username, answer);
        }

        IUser IUserProvider.GetUser(object providerUserKey, bool userIsOnline)
        {
            return _UnderlyingProvider.GetUser(providerUserKey, userIsOnline);
        }

        IUser IUserProvider.GetUser(string username, bool userIsOnline)
        {
            return _UnderlyingProvider.GetUser(username, userIsOnline);
        }

        string IUserProvider.GetUserNameByEmail(string email)
        {
            return _UnderlyingProvider.GetUserNameByEmail(email);
        }

        void IUserProvider.OnValidatingPassword(ValidatePasswordEventArgs e)
        {
            _UnderlyingProvider.OnValidatingPassword(e);
        }

        string IUserProvider.ResetPassword(string username, string answer)
        {
            return _UnderlyingProvider.ResetPassword(username, answer);
        }

        bool IUserProvider.UnlockUser(string userName)
        {
            return _UnderlyingProvider.UnlockUser(userName);
        }

        void IUserProvider.UpdateUser(IUser user)
        {
            _UnderlyingProvider.UpdateUser(user);
        }

        bool IUserProvider.ValidateUser(string username, string password)
        {
            return _UnderlyingProvider.ValidateUser(username, password);
        }

        #endregion
    }
}
